﻿using System;
using System.Linq;
using AutoR.Services;
using LiteDB;

namespace AutoR.Models
{
	// Token: 0x02000202 RID: 514
	public class StatEquipment
	{
		// Token: 0x17000374 RID: 884
		// (get) Token: 0x06000B91 RID: 2961 RVA: 0x0006D547 File Offset: 0x0006B747
		// (set) Token: 0x06000B92 RID: 2962 RVA: 0x0006D54F File Offset: 0x0006B74F
		public ObjectId Id { get; set; } = ObjectId.NewObjectId();

		// Token: 0x17000375 RID: 885
		// (get) Token: 0x06000B93 RID: 2963 RVA: 0x0006D558 File Offset: 0x0006B758
		// (set) Token: 0x06000B94 RID: 2964 RVA: 0x0006D560 File Offset: 0x0006B760
		public int EquipmentCid { get; set; }

		// Token: 0x17000376 RID: 886
		// (get) Token: 0x06000B95 RID: 2965 RVA: 0x0006D569 File Offset: 0x0006B769
		// (set) Token: 0x06000B96 RID: 2966 RVA: 0x0006D571 File Offset: 0x0006B771
		public int Count { get; set; }

		// Token: 0x17000377 RID: 887
		// (get) Token: 0x06000B97 RID: 2967 RVA: 0x0006D57A File Offset: 0x0006B77A
		[BsonIgnore]
		public string Name
		{
			get
			{
				EquipmentConfig equipmentConfig = Runtime.Configs.shipEquipment.SingleOrDefault((EquipmentConfig s) => s.cid == this.EquipmentCid);
				if (equipmentConfig == null)
				{
					return null;
				}
				return equipmentConfig.title;
			}
		}
	}
}
